import request from '~/utils/request'

export function login(data) {
    return request({
        url: '/auth/login',
        method: 'post',
        data
    })
}

export function getInfo(token) {
    return request({
        url: '/auth/userInfo',
        method: 'get',
        params: { token }
    })
}

export function logout() {
    return request({
      url: '/auth/logout',
      method: 'post'
    })
}

export function register(data) {
    return request({
        url: '/auth/register',
        method: 'post',
        data
    })
}

export function sendRegisterEmail(email, uuid) {
    return request({
        url: `/auth/sendRegisterEmail/${email}/${uuid}`,
        method: 'get'
    })
}


export function sendLoginEmail(email, uuid) {
    debugger
    return request({
        url: `/auth/sendLoginEmail/${email}/${uuid}`,
        method: 'get'
    })
}

export function emailLogin(data) {
    return request({
        url: `/auth/emailLogin`,
        method: 'post',
        data
    })
}

export function getUserInfo(){
    return request({
        url: `/system/user/getUserInfo`,
        method: 'post'
    })
}

export function updateUserById(userInfo){
  return request({
    url: `/system/user/updateUserById`,
    method: 'post',
    data: userInfo
  })
}

export function updateUserForUs(userInfo){
  return request({
    url: `/system/user/updateUserForUs`,
    method: 'post',
    data: userInfo
  })
}
